-
Notifications
You must be signed in to change notification settings - Fork 302
Add i18n fallback #815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add i18n fallback #815
Conversation
One personal expectation is to unify most (if not all) Chinese resources, taken the advantage of an automatic converter OpenCC (rust binding). OpenCC supports the convert between Simplified and Traditional characters as well as regional term (Mainland, Hong Kong, Taiwan, etc). It generally works well (it's the best one I ever see). |
Can you implement this on top of the Also, we'll have to have a hardcoded list of supported languages (for the dropdown) anyway, so we should probably structure this around that. |
@Manishearth Ok, no problem. |
@Manishearth I see in the code (both master and i18n branch) that the Would that be a good idea or a bad idea to minimize that piece of lifetime in struct's and function's definitions? |
We don't want to minimize it. It's a static object. Being We may want to make it possible to reload files while running, but that's a significant amount of work, and it has little benefit given our current deployment model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I'll test it out soon.
Thanks! |
This needs to be tweaked to deal with the governance stuff correctly, though. |
Oh, I realized that this approach won't work for the governance at all: We shouldn't use the fallback chain for defaulting to English, because our English default works differently in different places. Furthermore, we should definitely not be recomputing this each time. I've got a plan. |
Also, we shouldn't be using lifetimes here, again 😄 |
A better handler for i18n fallback, using fluent-locale.
This shall separate the logic for fallback, and make more advanced fallback implemented easier.